//
//  LRXTimeStamp.m
//  路人侠
//
//  Created by zhangxulong on 3/28/16.
//  Copyright © 2016 zhangxulong. All rights reserved.
//

#import "LRXTimeStamp.h"

@implementation LRXTimeStamp
//设置时间显示格式:
+ (NSString *)timeToTimeStamp:(NSString * )timeStr
{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateStyle:NSDateFormatterMediumStyle];
    [formatter setTimeStyle:NSDateFormatterShortStyle];
    [formatter setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
    
    
    NSTimeZone* timeZone = [NSTimeZone timeZoneWithName:@"Asia/Shanghai"];
    [formatter setTimeZone:timeZone];
    
    NSDate * date = [formatter dateFromString:timeStr];
    
    
    NSString * timeSp = [NSString stringWithFormat:@"%ld", (long)[date timeIntervalSince1970]];
    
    return timeSp;
}



@end
